#ifndef _QI_TYPE_H
#define _QI_TYPE_H

#include "../q_common.h"



struct qi_type;

struct qi_structmember
{
	/* name of struct member */
	char name[Q_MAX_SYMBOL_LENGTH];
	/* ptr to type of struct member */
	struct qi_type* member;
};

struct qi_type
{
	/* type name */
	char name[Q_MAX_SYMBOL_LENGTH];
	/* 0 - primitive types | > 0 - struct definitions */
	int size;
	struct qi_structmember* members;
	/* next vardef in chain */
	struct qi_type* next;
};

struct qi_typetable
{
	struct qi_type *data[Q_HASH_TABLE_SIZE];
};

/* types */
/* hash table with all defined types */
extern struct qi_typetable qi_types;
/* free all type definitions */
void qi_freetypes();
/* adds new type */
int qi_addtype(const char* const name, int size, ...);


#endif

